<template>
  <scroll-view
    class="detailForm-wrap"
    :show-scrollbar="false"
    :scroll-x="true"
    :scroll-y="true"
  >
    <tm-table
      :table-data="props.formInfo"
      :width="tableWidth"
      :cell-width="cellWidth"
      :stripe="stripe"
      :showHeader="showFixed"
      :headerHeight="80"
      :cellHeight="80"
    ></tm-table>
  </scroll-view>
</template>

<script lang="ts" setup>
import { ref, computed } from 'vue'
const showFixed = ref(true)
const stripe = ref(false)
type IProps = {
  formInfo: any[]
}
const props = defineProps<IProps>()
console.log(props, 'props999')
// 计算table宽度
const cellWidth = ref<number>(160)

const tableWidth = computed(() => {
  return uni.$tm.u.torpx(props.formInfo.header.length * cellWidth.value)
})
</script>

<style scoped></style>
